import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '公司logo',
    align:"center",
    dataIndex: 'logo',
    customRender:render.renderImage,
   },
   {
    title: '公司简称',
    align:"center",
    dataIndex: 'name'
   },
   {
    title: '公司全称',
    align:"center",
    dataIndex: 'fullName'
   },
   {
    title: '所属行业',
    align:"center",
    dataIndex: 'industryId'
   },
   {
    title: '所在行业',
    align:"center",
    dataIndex: 'industryName'
   },
   {
    title: '人员规模',
    align:"center",
    dataIndex: 'staffSize_dictText'
   },
   {
    title: '企业性质',
    align:"center",
    dataIndex: 'companyNature_dictText'
   },
   {
    title: '公司简介',
    align:"center",
    dataIndex: 'companyProfile'
   },
   {
    title: '公司福利',
    align:"center",
    dataIndex: 'welfare'
   },
   {
    title: '地址名称',
    align:"center",
    dataIndex: 'addressName'
   },
   {
    title: '公司地址',
    align:"center",
    dataIndex: 'address'
   },
   {
    title: '门牌号',
    align:"center",
    dataIndex: 'addressHouse'
   },
   {
    title: '地址经度',
    align:"center",
    dataIndex: 'longitude'
   },
   {
    title: '地址纬度',
    align:"center",
    dataIndex: 'latitude'
   },
   {
    title: '工作开始时间',
    align:"center",
    dataIndex: 'startTime'
   },
   {
    title: '工作结束时间',
    align:"center",
    dataIndex: 'endTime'
   },
   {
    title: '休息时间',
    align:"center",
    dataIndex: 'restTime'
   },
   {
    title: '加班情况',
    align:"center",
    dataIndex: 'workOvertime_dictText'
   },
   {
    title: '公司相册，逗号分隔',
    align:"center",
    dataIndex: 'album'
   },
   {
    title: '营业执照',
    align:"center",
    dataIndex: 'businessLicense',
    customRender:render.renderImage,
   },
   {
    title: '企业名称',
    align:"center",
    dataIndex: 'realName'
   },
   {
    title: '法人名称',
    align:"center",
    dataIndex: 'legalPerson'
   },
   {
    title: '营业执照号',
    align:"center",
    dataIndex: 'identity'
   },
   {
    title: '认证状态：0-默认，1-待审核，2-审核失败，3-审核通过',
    align:"center",
    dataIndex: 'verifyStatus'
   },
   {
    title: '失败原因',
    align:"center",
    dataIndex: 'refuseReason'
   },
   {
    title: '提交认证时间',
    align:"center",
    dataIndex: 'addAuthTime',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text)
    },
   },
   {
    title: '审核时间',
    align:"center",
    dataIndex: 'authDate',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text)
    },
   },
   {
    title: '浏览数量',
    align:"center",
    dataIndex: 'browseNumber'
   },
   {
    title: '县级城市名称',
    align:"center",
    dataIndex: 'city'
   },
   {
    title: '县级城市编码',
    align:"center",
    dataIndex: 'citycode'
   },
   {
    title: '市级城市名称',
    align:"center",
    dataIndex: 'pcity'
   },
   {
    title: '市级城市编码',
    align:"center",
    dataIndex: 'pcitycode'
   },
   {
    title: '排序',
    align:"center",
    dataIndex: 'sort'
   },
   {
    title: '备注',
    align:"center",
    dataIndex: 'remark'
   },
   {
    title: 'tenantId',
    align:"center",
    dataIndex: 'tenantId'
   },
   {
    title: '删除状态(0-正常,1-已删除)',
    align:"center",
    dataIndex: 'delFlag'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '公司logo',
    field: 'logo',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '公司简称',
    field: 'name',
    component: 'Input',
  },
  {
    label: '公司全称',
    field: 'fullName',
    component: 'Input',
  },
  {
    label: '所属行业',
    field: 'industryId',
    component: 'InputNumber',
  },
  {
    label: '所在行业',
    field: 'industryName',
    component: 'Input',
  },
  {
    label: '人员规模',
    field: 'staffSize',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"staff_size"
     },
  },
  {
    label: '企业性质',
    field: 'companyNature',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"company_nature"
     },
  },
  {
    label: '公司简介',
    field: 'companyProfile',
    component: 'InputTextArea',
  },
  {
    label: '公司福利',
    field: 'welfare',
    component: 'Input',
  },
  {
    label: '地址名称',
    field: 'addressName',
    component: 'Input',
  },
  {
    label: '公司地址',
    field: 'address',
    component: 'Input',
  },
  {
    label: '门牌号',
    field: 'addressHouse',
    component: 'Input',
  },
  {
    label: '地址经度',
    field: 'longitude',
    component: 'Input',
  },
  {
    label: '地址纬度',
    field: 'latitude',
    component: 'Input',
  },
  {
    label: '工作开始时间',
    field: 'startTime',
    component: 'TimePicker',
    componentProps: {
      valueFormat: 'HH:mm:ss'
    },
  },
  {
    label: '工作结束时间',
    field: 'endTime',
    component: 'TimePicker',
    componentProps: {
      valueFormat: 'HH:mm:ss'
    },
  },
  {
    label: '休息时间',
    field: 'restTime',
    component: 'Input',
  },
  {
    label: '加班情况',
    field: 'workOvertime',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"work_overtime"
     },
  },
  {
    label: '公司相册，逗号分隔',
    field: 'album',
    component: 'Input',
  },
  {
    label: '营业执照',
    field: 'businessLicense',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '企业名称',
    field: 'realName',
    component: 'Input',
  },
  {
    label: '法人名称',
    field: 'legalPerson',
    component: 'Input',
  },
  {
    label: '营业执照号',
    field: 'identity',
    component: 'Input',
  },
  {
    label: '认证状态：0-默认，1-待审核，2-审核失败，3-审核通过',
    field: 'verifyStatus',
    component: 'InputNumber',
  },
  {
    label: '失败原因',
    field: 'refuseReason',
    component: 'Input',
  },
  {
    label: '提交认证时间',
    field: 'addAuthTime',
    component: 'DatePicker',
  },
  {
    label: '审核时间',
    field: 'authDate',
    component: 'DatePicker',
  },
  {
    label: '浏览数量',
    field: 'browseNumber',
    component: 'InputNumber',
  },
  {
    label: '县级城市名称',
    field: 'city',
    component: 'Input',
  },
  {
    label: '县级城市编码',
    field: 'citycode',
    component: 'Input',
  },
  {
    label: '市级城市名称',
    field: 'pcity',
    component: 'Input',
  },
  {
    label: '市级城市编码',
    field: 'pcitycode',
    component: 'Input',
  },
  {
    label: '排序',
    field: 'sort',
    component: 'InputNumber',
  },
  {
    label: '备注',
    field: 'remark',
    component: 'Input',
  },
  {
    label: 'tenantId',
    field: 'tenantId',
    component: 'InputNumber',
  },
  {
    label: '删除状态(0-正常,1-已删除)',
    field: 'delFlag',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}